<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
	String name = request.getParameter("name");
	String age = request.getParameter("age");
	String[] favors = request.getParameterValues("favor");
%>   
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>网上调查结果</title>
</head>
<body>
	<div align="center">
		<form name="form1" method="post" action="inquiryinfo.jsp">
			<table border="0" align="center">
				<thead>
					<tr>
						<td colspan="2" align="center">
							您的调查结果
						</td>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td>您的姓名：</td>
						<td>
							<%=name %>
						</td>
					</tr>
					<tr>
						<td>年龄：</td>
						<td>
							<%=age %>
						</td>
					</tr>
					<tr>
						<td>爱好：</td>
						<td>
							<%
							if (favors != null) {
								for (int i=0; i<favors.length; i++) {
									out.print(favors[i] + "&nbsp;");
								}
							}
							%>
						</td>
					</tr>
				</tbody>
					<tr>
						<td colspan="2" align="center">
							总调查人数：
							<%
								Integer count = (Integer) application.getAttribute("count");
								if (count == null) {
									count = new Integer(1);
								} else {
									count++;
								}
								application.setAttribute("count", count);
								out.print(count + "人");
							%>
						</td>
					</tr>
				<tfoot>
				</tfoot>
			</table>
		</form>
	</div>
</body>
</html>